import {ajaxPostJson, ajaxGetJson} from './ajax';
import urls from '@/services/urls';
import $lodash from "lodash";
import qs from "qs";
//登录-TODO
export const loginAjax = (param) => {
    const filterParam = $lodash.pickBy(param);
    let url = qs.stringify(filterParam);
    return ajaxPostJson(`/user/login?${url}`, param, "BaseApi1", 0);
};

//获取路由
export const routerInfoAjax = (param) => {
    return ajaxGetJson(`/Hospital/getMenuList`, param, "BaseApi", 0);
};

export const categoryInfoAjax = (param) => {
    const filterParam = $lodash.pickBy(param);
    let url = qs.stringify(filterParam);
    return ajaxGetJson(`/category/getList?${url}`, param, "BaseApi", 0);
};

// 依据类目获取文化理念&患者心声最近的详情
export const cultureAspirationDetailsAjax = (param) => {
    const filterParam = $lodash.pickBy(param);
    let url = qs.stringify(filterParam);
    return ajaxGetJson(`/selfCheckMachine/resource/getResourceInfoByCategoryId?${url}`, param,"BaseApi", 0);
};

export const cultureAspirationDetailsAjax2 = (param) => {
    const filterParam = $lodash.pickBy(param);
    let url = qs.stringify(filterParam);
    return ajaxGetJson(`/selfCheckMachine/resource/getResourceInfoById?${url}`, param,"BaseApi", 0);
};


// 根据类目获取医院介绍详情
export const hospitalInfoDetailsAjax = (param) => {
    const filterParam = $lodash.pickBy(param);
    let url = qs.stringify(filterParam);
    return ajaxGetJson(`/Hospital/getHospitalIntroByCategoryId?${url}`, param,"BaseApi", 0);
};

// 医院导航--楼宇--楼层--科室信息
export const hospitalFloorDeptAjax = (param) => {
    return ajaxGetJson(`/selfCheckMachine/dept/getBuildingFloorDept`, param,"BaseApi", 0);
};

//全局搜索
export const searchInfoAjax = (param) => {
    const filterParam = $lodash.pickBy(param);
    let url = qs.stringify(filterParam);
    return ajaxGetJson(`/search/list?${url}`, param,"BaseApi", 0);
};
